<?php
/* [$WindsForce] (C)Hunzhiwange.COM Since 2014.07.14.
   家居公司视频显示($$)*/

!defined('Q_PATH') && exit;

class Videoshow_C_Controller extends InitController{

	public function index(){
		$arrJiajucompany=$this->_oParent->_arrJiajucompany;
		$nId=intval(Q::G('id','G'));

		if(!$nId){
			$this->page404();
		}

		// 视频显示
		$arrWhere=array();
		$arrWhere['A.jiajuvideo_status']=1;
		$arrWhere['A.jiajuvideo_id']=$nId;
		$arrWhere['A.jiajucompany_id']=$arrJiajucompany['jiajucompany_id'];

		$arrVideo=Model::F_('jiajuvideo','@A')
			->setColumns('A.jiajuvideo_id,A.jiajuvideo_title,A.create_dateline,A.jiajuvideo_viewnum,A.jiajuvideo_filename,A.jiajuvideo_description')
			->where($arrWhere)
			->getOne();

		if(empty($arrVideo['jiajuvideo_id'])){
			$this->page404();
		}

		// 更新点击量
		Model::M_('jiajuvideo')->updateWhere(array('jiajuvideo_viewnum'=>$arrVideo['jiajuvideo_viewnum']+1),'jiajuvideo_id=?',$nId);
		$arrVideo['jiajuvideo_viewnum']++;

		Core_Extend::getSeo($this,array(
			'title'=>"{$arrVideo['jiajuvideo_title']}视频展示",
			'keywords'=>"{$arrVideo['jiajuvideo_title']}视频展示",
			'description'=>"{$arrVideo['jiajuvideo_title']}视频展示",
		));

		$this->assign('arrVideo',$arrVideo);
		$this->display(Jiaju_Extend::getTemplate($arrJiajucompany,'videoshow'));
	}

}
